@extends('admin.layout.layout')
@section('content')

<div id="app">
    <main>
        <div id="primary" class="p-t-b-100 height-full">
            <div class="container">
                <div class="row">
                    <div class="col-lg-4 mx-md-auto paper-card">
                        <div class="text-center">
                        <img src="{{asset('assets/img/dummy/u1.png')}}" alt="">
                            <h3 class="mt-2">Welcome Back
                                @isset($reload)
                                   123
                                @endisset
                            </h3>
                            <p class="p-t-b-20"></p>
                        </div>
                        <form id="login">
                            <div class="form-group has-icon"><i class="icon-account_box"></i>
                                <input type="text" class="form-control form-control-lg"
                                       placeholder="用户名" name="account">
                            </div>
                            <div class="form-group has-icon"><i class="icon-lock4"></i>
                                <input type="password" class="form-control form-control-lg"
                                       placeholder="密码" name="password">
                            </div>
                            <input type="submit" class="btn btn-primary btn-lg btn-block" value="登录">
                            <p class="forget-pass mt-3">忘记密码? 请联系管理员! 
                                    </p> 
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <script>
            $("#login").submit(function(){

                var formData=$(this).serialize();
                $.get('{{url("/admin/login?")}}'+formData,function(res){
                    if(res.status===200){
                        setTimeout(function(){
                            window.location.href="{{url('/admin')}}";
                        },1500);
                        toastr.success(res.msg);
                    }else{
                        toastr.info(res.msg);
                    }
                });
                return false;
            });
            

    </script>


@endsection